#pragma once

static inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus)
{
    unsigned long flags;
    int ret;

    local_irq_save(flags);
    ret = fn(data);
    local_irq_restore(flags);

    return ret;
}

static inline int stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus)
{
    return stop_machine_cpuslocked(fn, data, cpus);
}
